package com.tt.job.manage.dto;

import java.io.Serializable;

public class Response<T> implements Serializable {
    private String code;
    private T data;

    public Response(T data) {
        this.code = ReturnCode.SUCCESS;
        this.data = data;
    }

    public Response(String returnCode) {
        this.code = returnCode;
    }

    public Response(String returnCode, T data) {
        this.code = returnCode;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public final static class ReturnCode {
        public final static String EXCEPTION = "9999";
        public final static String FAILED = "0001";
        public static final String PARAMETER_ERROR = "0002";
        public final static String SUCCESS = "0000";
    }

}
